﻿using UnityEngine;

[RequireComponent(typeof(Animation))]
public class NAnimationController : MonoBehaviour
{
    private Animation m_Animation;
    private Animation AnimationComponent
    {
        get
        {
            if (!m_Animation)
            {
                m_Animation = m_Animation = transform.GetComponent<Animation>();
            }
            return m_Animation;
        }
    }

    public void PlayAnimation(string animationName)
    {
        AnimationComponent.Play(animationName);
    }

    public void Play()
    {
        AnimationComponent.Play();
    }

    public void Stop()
    {
        AnimationComponent.Stop();
    }
}